function Set-AzureDataFactoryV2 {
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory = $true)][string][ValidateScript({ !([string]::IsNullOrWhiteSpace($_)) })]$ADFv2Name,
        [Parameter(Mandatory = $true)][string][ValidateScript({ !([string]::IsNullOrWhiteSpace($_)) })]$ResourceGroupName,
        [Parameter(Mandatory = $true)][string][ValidateScript({ !([string]::IsNullOrWhiteSpace($_)) })]$ProjectTemplateFile,
        [Parameter(Mandatory = $true)][string][ValidateScript({ !([string]::IsNullOrWhiteSpace($_)) })]$ProjectTemplateParameterFile,
        [Parameter(Mandatory = $true)][secureString]$LSCentralPassword,
        [Parameter(Mandatory = $true)][securestring]$LSInsightPassword
    )

    # 'Configure' the Azure Data Factory v2 resource.
    $params = @{
        Name = $ADFv2Name
        ResourceGroupName = $ResourceGroupName
        TemplateFile = $ProjectTemplateFile
        TemplateParameterFile = $ProjectTemplateParameterFile
        Force = $true
    }
    New-AzResourceGroupDeployment @params -Password $($LSInsightPassword | ConvertTo-LSPlainText) -SqlPassword $($LSCentralPassword | ConvertTo-LSPlainText) | Out-Null
}